home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mm / ccmd / cmswi.cnf < prev    next >
Encoding:
Text File  |  1990-12-18  |  1.6 KB  |  46 lines

  1. _
  2. _ Copyright (c) 1986, 1990 by The Trustees of Columbia University in
  3. _ the City of New York.  Permission is granted to any individual or
  4. _ institution to use, copy, or redistribute this software so long as it
  5. _ is not sold for profit, provided this copyright notice is retained.
  6. _
  7. _ Author: Andrew Lowry
  8.  
  9. /* switch parsing errors */
  10.  
  11. fnerror(NM,`Does not match switch')
  12. fnerror(AMB,`Ambiguous')
  13. fnerror(ABR,`Invalid abbreviation chain in switch table')
  14. fnerror(BEG,`Switch does not begin with required punctuation')
  15. fnerror(END,`Final switch punctuation not allowed on selected switch')
  16.  
  17. /*
  18.  * SWTCH structure specifies one entry in a switch table.  SWITAB
  19.  * structure describes a table of switches.  (We use the name
  20.  * swtch instead of switch because the latter is a C reserved word.)
  21.  */
  22.  
  23. typedef struct SWTCH {
  24.     char *    _swswi;        /* switch string (without punctuation)  */
  25.     short    _swflg;        /* flags (see below) */
  26.     int    _swval;        /* arbitrary value, not used internally */
  27.                 /*  except for abbreviations... see SWI_ABR */
  28.                 /*  flag below */
  29. } swtch;
  30.  
  31. typedef struct SWITAB {
  32.     int    _stcnt;        /* number of switches in table */
  33.     swtch  * _stwds;    /* array of switch entries  */
  34. } switab;
  35.  
  36. /* Flags that can be present in a switch entry */
  37.  
  38. fnflag(ABR)            /* switch is an abbreviation for the */
  39.                 /* switch indexed by this entry's _swval */
  40.                 /* value */
  41. fnflag(NOR)            /* Ignore this switch (do not recognize */
  42.                 /*  any prefix, or even an exact match) */
  43. fnflag(INV)            /* Invisible switch (not shown with help) */
  44. fnflag(MAT)            /* This switch matches current input (used */
  45.                 /*  internally) */
  46.